<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
	android:focusable="true"
	android:focusableInTouchMode="true"
	android:background="#FFFFFF"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="org.notabug.lifeuser.moviedb.DetailActivity"
    tools:showIn="@layout/app_bar_detail">
	<requestFocus />

    <ImageView
        android:id="@+id/movieImage"
        android:layout_width="match_parent"
        android:layout_height="180dp"
        android:scaleType="centerCrop"
        android:background="@color/colorPrimary" />

    <RelativeLayout
        android:id="@+id/movieDetails"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/movieImage"
        android:layout_margin="16dp">

        <ImageView
            android:id="@+id/moviePoster"
            android:layout_width="75dp"
            android:layout_height="120dp"
            android:layout_marginRight="10dp" />

        <TextView
            android:id="@+id/movieTitle"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@id/moviePoster"
            android:textSize="25dp"
            android:textStyle="bold"
            android:textColor="@color/colorBlack" />

        <TextView
            android:id="@+id/movieGenres"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/movieTitle"
            android:layout_toRightOf="@id/moviePoster" />

		<TextView
			android:id="@+id/movieStartDate"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:layout_below="@id/movieGenres"
			android:layout_toRightOf="@id/moviePoster"
			android:visibility="gone"
			android:onClick="changeMovieDate" />

		<TextView
			android:id="@+id/movieFinishDate"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:layout_below="@id/movieStartDate"
			android:layout_toRightOf="@id/moviePoster"
			android:visibility="gone"
			android:onClick="changeMovieDate" />

		<TextView
			android:id="@+id/movieRewatched"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:layout_below="@id/movieFinishDate"
			android:layout_toRightOf="@id/moviePoster"
			android:visibility="gone"
			android:onClick="changeRewatched" />

        <RatingBar
            android:id="@+id/movieRating"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@id/movieRewatched"
            android:layout_toRightOf="@id/moviePoster"
            android:layout_marginBottom="5dip"
            style="?android:attr/ratingBarStyleSmall"
            android:numStars="5"
            android:rating="3.5"
			android:onClick="changeRating" />

    </RelativeLayout>

    <View
        android:id="@+id/firstDivider"
        android:layout_width="match_parent"
        android:layout_height="2dp"
        android:layout_below="@id/movieDetails"
        android:layout_marginLeft="16dp"
        android:layout_marginRight="16dp"
        android:background="?android:attr/listDivider" />

    <TextView
        android:id="@+id/movieDescription"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/firstDivider"
        android:layout_margin="16dp" />

    <LinearLayout
        android:id="@+id/listButtons"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/movieDescription"
        android:gravity="center_horizontal">

        <Button
            android:id="@+id/watchButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="start"
            android:text="@string/watch_list"
            android:onClick="addMovieToToWatchList"/>

        <Button
            android:id="@+id/watchedButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="end"
            android:text="@string/watched_list"
            android:onClick="addMovieToWatchedList"/>
    </LinearLayout>

    <android.support.v7.widget.RecyclerView
        android:id="@+id/castRecyclerView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/listButtons"
		android:background="@android:color/transparent"
        android:scrollbars="none" />

    <View
        android:id="@+id/secondDivider"
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:layout_below="@id/castRecyclerView"
        android:layout_marginLeft="16dp"
        android:layout_marginRight="16dp"
        android:background="?android:attr/listDivider" />

    <android.support.v7.widget.RecyclerView
        android:id="@+id/movieRecyclerView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/secondDivider"
        android:scrollbars="none" />

</RelativeLayout>

